#include "LuminusMaterius.h"


LuminusMaterius::LuminusMaterius(Vector3 color, float wattage) : 
	m_color(color), m_wattage(wattage)
{
}


LuminusMaterius::~LuminusMaterius(void)
{
}

Vector3 LuminusMaterius::shade(const Ray& ray, const HitInfo& hit, char rayCount, const Scene& scene,
                          int mode, Vector3 rayColor, bool diffuseRay) const
{
    ////////////// create measurement point
    if (mode == APPM_MEAS && rayCount < MAX_REFLECTIONS)
    {
    	HPoint *hp = new HPoint;
    	hp->isLight = true;
    	hp->f = rayColor * m_color * m_wattage; // we'll just directly use this for rendering
    	hp->pos = hit.P;
    	hp->norm = hit.N;
    	hp->pix = g_pixel_index;
    	g_hitpoints = g_hitpoints->ListAdd(hp);

    	return Vector3(0);
    }

	if (NUM_LIGHT_SAMPLES > 0 && diffuseRay)
		return Vector3(0);

	return m_color * m_wattage;
}

void LuminusMaterius::handlePhoton(const Ray& ray, const HitInfo& hit, char rayCount, Vector3 photonFlux, const Scene& scene, int mode, LightPath *lp) const
{
}
